/**
 * Created by wenquxing on 2016/5/25.
 */
function  release() {
    var content =$("#publish").val() ;
    if(content=="")
    {
        $('#tip').html("<div class='alert alert-danger' >内容不能为空</div>");
        return false;
    }else {
        $.ajax({
            url : "/post",
            type : "post",
            dataType : "json",
            data:{
                content:content
            },
            success : function(data) {
                if(data.flag=="true"){
                    location.href = "/";//location.href实现客户端页面的跳转
                }else{
                    $('#tip').html("<div class='alert alert-danger' >发布失败</div>");
                    return false;
                }

            },
            error : function() {
                $('#tip').html("<div class='alert alert-danger' >发布失败</div>");
                return false;
            }
        });
    }
}